﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Medicalsystem.Docare.Common.Configuration
{
   public class InstanceBuilderSettings
    {
       private static InstanceBuilderCollection _typeMappings = null;

        public static InstanceBuilderSection GetConfigurationSection()
        {
            return ConfigurationManager.GetSection("InstanceBuilderSetting") as InstanceBuilderSection;
        }

      
        public static InstanceBuilderCollection GetTypeMappings()
        {
            if (_typeMappings == null)
            {
                var section = GetConfigurationSection();
                if (section == null)
                {
                    return null;
                   // throw new ConfigurationErrorsException("InstanceBuilderSetting");
                }
                _typeMappings = section.TypeMappings;
            }

            return _typeMappings;
        }
    }
}
